<?php
error_reporting(0);
include_once 'check.php';
function deldir($dir) {
  $dh=opendir($dir);
  while ($file=readdir($dh)) {
    if($file!="." && $file!="..") {
      $fullpath=$dir."/".$file;
      if(!is_dir($fullpath)) {
          unlink($fullpath);
      } else {
          deldir($fullpath);
      }
    }
  }

  closedir($dh);
  
  if(rmdir($dir)) {
    return true;
  } else {
    return false;
  }
}
if(is_dir("../data/Apicache")){
deldir("../data/Apicache");
}
echo "<META http-equiv=Content-Type content=\"text/html; charset=utf-8\"><script language=javascript>alert('恭喜您，所有缓存清理完毕！');window.location='temp.php'</script>";
?>